#include <iostream>
#include <cstdio>
#include <unistd.h>
#include <cstdlib>
#include <cstring>
using namespace std;

int main(int arg, char* argv[])
{
  if (arg < 2)
  {
    cout << "缺少参数" << endl;
    exit(-1);
  }


  FILE* fp = fopen(argv[1], "r");
  if (fp == NULL)
  {
    perror("fopen:");
    exit(-1);
  }
  
  char line[64];
  while (fgets(line, sizeof(line), fp) != NULL)
  {
    fprintf(stdout, "%s", line);
  }

//  const char* s1 = "using fwrite\n";
//  fwrite(s1, strlen(s1) , 1, fp);
//
//  const char* s2 = "using fprintf\n";
//  fprintf(fp, "%s", s2);
//
//  const char* s3 = "using fputs\n";
//  fputs(s3, fp);
  
  fclose(fp);
  return 0;
}



